import { getHomeServiceTypeQty } from '@/api/home'
import { ref } from 'vue'

export default () => {
  // 获取工单服务类型统计数量
  const getServiceTypeQtyLoading = ref(false)

  // 服务类型统计数量
  const serviceTypeQty = ref<Array<HomeServiceTypeQty>>([])

  /**
   * 获取服务类型统计数量
   */
  const getServiceTypeQty = async () => {
    getServiceTypeQtyLoading.value = true
    const res = await getHomeServiceTypeQty()
    serviceTypeQty.value = res.data.data.row
    getServiceTypeQtyLoading.value = false
  }

  return {
    serviceTypeQty,
    getServiceTypeQtyLoading,
    getServiceTypeQty,
  }
}
